
<?php
// Yii::app()->clientScript->registerCoreScript('bbq');
// var_dump($data);die();
$this->breadcrumbs=array(
	'Users Management' => 'index',
);
Yii::app()->clientScript->registerScript('search', "
$('.search-form form').submit(function(){
    $.fn.yiiGridView.update('users-model-grid', {
        data: $(this).serialize()
    });
    return false;
});
");

Yii::app()->clientScript->registerScript('ajaxupdate', "
$('#users-model-grid a.ajaxupdate').click(function() {
    $.fn.yiiGridView.update('users-model-grid', {
        type: 'POST',
        url: $(this).attr('href'),
        success: function() {
            $.fn.yiiGridView.update('users-model-grid');
        }
    });
    return false;
});
");
?>  

<div>
    <div class="pull-right">
        <div class="widget-toolbar">
            <a href="<?php echo Yii::app()->createAbsoluteUrl($parentUrl . '/create'); ?>" role="button" class="white" data-toggle="modal"  title="Add new category">
                <i class="icon-plus"></i>
            </a>
        </div>
    </div>
</div>
<div class="row-fluid">
    <div class="row-fluid">
        <div class="table-header">
            Users Management
        </div>
        <!-- <div class="span6"> -->
            <div id="sample-table-2_length" class="dataTables_length">
                <!--<label>Display <select name="sample-table-2_length" size="1" aria-controls="sample-table-2"><option value="10" selected="selected">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select> records</label>-->
            </div>
<!--         </div>
        <div class="span6"> -->
                        <?php $this->renderPartial('_search', array( 'model' => $data ));?>
                <!-- </div> -->
         <?php
            $this->widget('bootstrap.widgets.TbGridView', array(
                'type' => 'striped bordered condensed',
                 'id' => 'users-model-grid',
                'dataProvider' => $data->search(),
                'template' => "{items}\n{pager}",
//              'headerHtmlOptions'=>array('width'=>'80px'),
                'columns' => array(
                    array(
                        'header' => '#',
                        'type' => 'raw',
                        'value' => '$row',
                        'headerHtmlOptions' => array('style' => 'text-align:center;'),
                        'htmlOptions' => array('style' => 'text-align:center;')
                    ),
//                                        'title',
                    array(
                        'name' => 'email',
                        'header' => 'Email',
                        'headerHtmlOptions' => array('style' => 'text-align:center;'),
                    ),
                    array(
                        'header' => 'Full Name',
                        // 'type' => 'first_name',
                        'htmlOptions' => array('style' => 'text-align:center;'),
                        'headerHtmlOptions' => array('style' => 'text-align:center;'),
                        'value' => '$data->first_name . " " . $data->last_name',
                    ),
//                                        'status:status',
                    array(
                        'header' => 'Status',
                        'name' => 'status',
                        // 'type' => 'status',
                        'headerHtmlOptions' => array('style' => 'text-align:center;'),
                        'htmlOptions' => array('style' => 'text-align:center;'),
                        'value' => '$data->status == 1 ? "Active" : "Inactive"'
                    ),
/*                    array(
                        'name' => 'categories_id',
                        'header' => 'Thể loại',
                        'htmlOptions' => array('style' => 'text-align:center;'),
                        'headerHtmlOptions' => array('style' => 'text-align:center;'),
                        'value' => '$data->first_name'
                    ),*/
                    // array(
                    //     'name' => 'Tự viết',
                    //     'type' => 'raw',
                    //     'htmlOptions' => array('style' => 'text-align:center;'),
                    //     'headerHtmlOptions' => array('style' => 'text-align:center;'),
                    //     // 'value' => ''
                    // ),
                    // array(
                    //     'name' => 'count',
                    //     'header' => 'Lượt xem',
                    //     'headerHtmlOptions' => array('width' => '50px', 'style' => 'text-align:center;'),
                    //     'htmlOptions' => array('style' => 'text-align:center;')
                    // ),
                    array(
                        'class' => 'bootstrap.widgets.TbButtonColumn',
                        // 'htmlOptions' => array('style' => 'width: 70px'),
                    ),
                ),
            ));
            ?>          
    </div>
</div><!--/.row-fluid-->